<template>
  <q-page padding>
    <div class="fixed-center text-h6">
      <div class="q-my-lg">欢迎用户：{{ user.nickname ?? user.username }}</div>
      <div>当前时间：{{ formatDate(dateNow, 'YYYY-MM-DD HH:mm:ss') }}</div>
    </div>

    TODO:看板图表

  </q-page>
</template>

<script setup lang="ts">
  import { ref } from 'vue';

  import { formatDate } from 'src/utils';
  import { useUserStore } from 'src/stores';

  defineOptions({ name: 'IndexPage' });

  const user = useUserStore();
  const dateNow = ref(new Date());
  setInterval(() => (dateNow.value = new Date()), 1000);
</script>
